#Change this to the path to your installed sc-config script.

TA_ROOT=/Users/drewlewis/software/install/tiledarray/july9-opt-c++11
EIGEN_ROOT=/usr/local/include/eigen3
MPQC_ROOT=/Users/drewlewis/software/install/mpqc/july9-test

MPQCCONFIG=$(MPQC_ROOT)/bin/mpqc-config
CXX=mpicxx
CXXFLAGS=$(shell $(MPQCCONFIG) --cxxflags)
CC=$(shell $(MPQCCONFIG) --cc)
CCFLAGS=$(shell $(MPQCCONFIG) --cflags)
CXXFLAGS+=-I$(TA_ROOT)/include/ 
CXXFLAGS+=-I$(EIGEN_ROOT) 
CXXFLAGS+=-g
CPPFLAGS=$(shell $(MPQCCONFIG) --cppflags)
LIBS=-L$(TA_ROOT)/lib -lMADworld
LDFLAGS=-Wl,-no_pie
LIBS+=$(shell $(MPQCCONFIG) --libs)

aoints: aoints.o Density.o tiles.o Dmm_scf.o 
	$(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) $(LDFLAGS)

aoints.o: aoints.cc Density.h Global.h Input.h tiles.h integrals/IntegralEnginePool.h \
k-means/atom_ordering.h Dmm_scf.h k-means/kcenter.h integrals/TilePack.h \
integrals/integrals.hpp direct_tile.h Makefile 
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o aoints.o aoints.cc
	
density.o: Density.cc Density.h Global.h Makefile
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o density.o Density.cc

tiles.o: tiles.cc integrals/IntegralEnginePool.h Global.h integrals/integrals.hpp \
integrals/range.hpp integrals/tensor.hpp Makefile
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o tiles.o tiles.cc
	
Dmm_scf.o: Dmm_scf.cc Dmm_scf.h Global.h Density.h
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o Dmm_scf.o Dmm_scf.cc

clean:
	-rm -f aoints.o aoints tiles.o Density.o input.o Dmm_scf.o \
	*.xyz
	
